package StringDemo1;

import java.util.Scanner;

public class Stringdemo1
{
    public static void main(String[] args) {
        String s1 = "hello,黑马";
        System.out.println(s1);
        System.out.println(s1.length());

        System.out.println("==========================");
        String t1 = "abc";
        String t2 = "abc";
        System.out.println(t1 == t2);
        String t3 = new String("abc");
        String t4 = new String("abc");
        System.out.println(t3 == t4);

        //简易版的登录：
        String okloginName = "admin";
        System.out.println("请输入用户名:");
        Scanner sc = new Scanner(System.in);
        String tep = sc.next();
        if(okloginName.equals(tep))
        {
            System.out.println("登录成功");
        }
        else
        {
            System.out.println("登录失败");
        }

        System.out.println("==========================");
        System.out.println("请输入手机号登录");
        String phone =sc.next();//
        System.out.println("系统显示手机号进入");//15892640696
        String newPhone = phone.substring(0,3) + "****"+ phone.substring(7);
        System.out.println(newPhone);
    }


}
